//
//    LunokWatch, a open source smartwatch software
//    Copyright (C) 2022,2023  Jordi Rubió <jordi@binarycell.org>
//    This file is part of LunokWatch.
//
// LunokWatch is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software 
// Foundation, either version 3 of the License, or (at your option) any later 
// version.
//
// LunokWatch is distributed in the hope that it will be useful, but WITHOUT 
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 
// details.
//
// You should have received a copy of the GNU General Public License along with 
// LunokWatch. If not, see <https://www.gnu.org/licenses/>. 
//

#ifndef __LUNOKIOT__APPLICATION__CALENDAR__
#define __LUNOKIOT__APPLICATION__CALENDAR__

#include "../UI/AppTemplate.hpp"
#include "../UI/widgets/ButtonTextWidget.hpp"

class CalendarApplication : public TemplateApplication {
    private:
        unsigned long nextRefresh=0;
        int year=0;
        int monthDay=0;
        int monthToShow=0;
        ButtonTextWidget *nextBtn=nullptr;
        ButtonTextWidget *lastBtn=nullptr;
        static const uint8_t MAXDAYS=32;
        bool databaseFoundDay[MAXDAYS] = { false }; // to set "dot" on day of month
        void CheckDatabasesForMonth();
    public:
        const char *AppName() override { return "Calendar"; };
        CalendarApplication();
        ~CalendarApplication();
        bool Tick();
};

#endif
